package day05;

import java.util.Random;

public class MethedDemo2 {
    public static void main(String[] args) {
        System.out.println(sum(1,2));
        System.out.println("-----------------------");
        int[] arr1 = generateArray(100,10);
        System.out.println("长度为"+arr1.length);
        for (int i=0 ; i<arr1.length ; i++){
            System.out.println(arr1[i]);
        }


    }
    public static int sum(int num1 , int num2){
        int num = num1+num2;
        return num;
    }
    public static int[] generateArray(int len , int max){
        Random random = new Random();
        int[] arr = new int[len];
        for (int i=0 ; i<arr.length ; i++){
            arr[i]=random.nextInt(max+1);
        }
        return arr;
    }
}
